<?php
namespace Badmins\Model;
use Think\Model;
class AttributeModel extends Model{
	protected $_validate = array(
			array('name','require','规格名称必须'),
			array('sort','number','权重值必须'),
			array('type','cktype','请输入属性值',1,'callback',3),
	);
	public function cktype($data){
		if($data == 1 || $data == 2 || $data == 3){
			if(empty($_POST['value'])){
				return false;
			}
		}
		return true;
	}
}